Eclipse Platform
Pre-release 3.0

org.eclipse.team.ui.synchronize.actions
Class SubscriberAction

java.lang.Object
  extended byorg.eclipse.ui.actions.ActionDelegate
      extended byorg.eclipse.team.internal.ui.actions.TeamAction
          extended byorg.eclipse.team.ui.synchronize.actions.SubscriberAction
All Implemented Interfaces:
IActionDelegate, IActionDelegate2, IObjectActionDelegate, IViewActionDelegate

public abstract class SubscriberAction
extends org.eclipse.team.internal.ui.actions.TeamAction
implements IViewActionDelegate

This is an abstract superclass for actions associated with a TeamSubscriberParticipant. It provides helper methods to access and filter selections that contain ITeamSubscriberParticipantNode instances.

It is optional for TeamSubscriberParticipant actions to subclass.

Since:
3.0

Field Summary
static QualifiedName SUBSCRIBER_JOB_TYPE
           
 
Fields inherited from class org.eclipse.team.internal.ui.actions.TeamAction
PROGRESS_BUSYCURSOR, PROGRESS_DIALOG, PROGRESS_WORKBENCH_WINDOW, selection, shell
 
Constructor Summary
SubscriberAction()
           
 
Method Summary
protected  SyncInfo[] getFilteredSyncInfos()
          Return the selected SyncInfo for which this action is enabled.
protected  SyncInfoFilter getSyncInfoFilter()
           
protected  SyncInfo[] getSyncInfos()
          This method returns all instances of SynchronizeViewNode that are in the current selection.
protected  boolean isEnabled()
          The default enablement behavior for subscriber actions is to enable the action if there is at least one SyncInfo in the selection for which the action is enabled (determined by invoking isEnabled(SyncInfo)).
protected  boolean select(SyncInfo info)
          Return true if the action should be enabled for the given SyncInfo.
 
Methods inherited from class org.eclipse.team.internal.ui.actions.TeamAction
getAdapter, getProviderMapping, getProviderMapping, getSelectedAdaptables, getSelectedProjects, getSelectedResources, getSelectedResources, getShell, getTargetPage, getTargetPart, handle, init, run, selectionChanged, setActionEnablement, setActivePart, showView
 
Methods inherited from class org.eclipse.ui.actions.ActionDelegate
dispose, init, run, runWithEvent
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.eclipse.ui.IViewActionDelegate
init
 
Methods inherited from interface org.eclipse.ui.IActionDelegate
run, selectionChanged
 

Field Detail

SUBSCRIBER_JOB_TYPE

public static final QualifiedName SUBSCRIBER_JOB_TYPE
Constructor Detail

SubscriberAction

public SubscriberAction()
Method Detail

getSyncInfos

protected SyncInfo[] getSyncInfos()
This method returns all instances of SynchronizeViewNode that are in the current selection. For a table view, this is any resource that is directly selected. For a tree view, this is any descendants of the selected resource that are contained in the view.

Returns:
the selected resources

isEnabled

protected boolean isEnabled()
                     throws TeamException
The default enablement behavior for subscriber actions is to enable the action if there is at least one SyncInfo in the selection for which the action is enabled (determined by invoking isEnabled(SyncInfo)).

Returns:
whether the action is enabled
Throws:
TeamException - if an error occurs during enablement detection
See Also:
TeamAction.isEnabled()

select

protected boolean select(SyncInfo info)
Return true if the action should be enabled for the given SyncInfo. Default behavior is to use a SyncInfoFilter to determine if the action is enabled.

Parameters:
info -
Returns:

getSyncInfoFilter

protected SyncInfoFilter getSyncInfoFilter()

getFilteredSyncInfos

protected SyncInfo[] getFilteredSyncInfos()
Return the selected SyncInfo for which this action is enabled.

Returns:

Eclipse Platform
Pre-release 3.0

Copyright (c) IBM Corp. and others 2000, 2003. All Rights Reserved.